/*
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package factory;

import java.sql.Connection;
import java.sql.DriverManager;

public final class ExBaseConnectionFactory  extends ConnectionDb{
    
    public ExBaseConnectionFactory() {
        this.open();
    }

    @Override
    public Connection open() {
        String className = "jstels.jdbc.dbf.DBFDriver";
        String url;
        
        String strOS = System.getProperty("os.name").toLowerCase();
        if (strOS.startsWith("windows")) {
            url = "jdbc:jstels:dbf:C:\\india\\ENTREGAS";
        } else {
            url = "jdbc:jstels:dbf:/home/india/india/ENTREGAS";
        }
        try {
            Class.forName(className);
            this.connection = DriverManager.getConnection(url);
                    
        } catch (Exception e) {
            e.printStackTrace();
        }
        return this.connection;
    }
}
